<?php

namespace app\http\middleware;

class CheckLogin
{

    /**
     * 不进行校验的路由
     */
//    private $exclude_route = [
//        'api/common/v1/login',
//        'api/common/v1/demo'
//    ];

    public function handle($request, \Closure $next, $params)
    {
        //登录逻辑
        echo "登录判断<br>";

        //中间件传值
        //echo $params;
        $request->name = "zhangsan";

        //放行
        return $next($request);
    }
}
